package com.servlet.form;

import java.io.IOException;
import java.sql.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.listener.ContextListener;
import com.servlet.model.base.Contact;
import com.servlet.model.base.Experience;
import com.servlet.model.base.News;
import com.servlet.model.database.BaseAcces;

public class SuppressionNewForm extends HttpServlet
{
	public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
	{	
		HttpSession session = request.getSession();
		
		BaseAcces base = ContextListener.base;
		String email = (String) session.getAttribute("email");

		ArrayList<News> news = (ArrayList<News>) (session.getAttribute("news"));

		int num = Integer.parseInt(request.getParameter("num"));
		
		base.removeNews(news.get(num));

		response.sendRedirect("news");
	}
}
